package com.xm_jd.controller.goods;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.xm_jd.model.dao.TianDao;
import com.xm_jd.utils.BaseServlet;

/**
 * Servlet implementation class JiajianSe
 */
@WebServlet("/jiajianSe")
public class JiajianSe extends BaseServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public JiajianSe() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
				String jh=request.getParameter("jian");
				String shuliang=request.getParameter("shuliang");
				String jj=request.getParameter("jia");
				String id=request.getParameter("id");
				
				String jiage=request.getParameter("jiage");
				//��new��dao
				TianDao ad=new TianDao();
				if(jh!=null&&new Integer(shuliang)>1){
					
					ad.jianshu(id);		
				}else if(jj!=null){
					
					ad.jiajiashu(id);
				}
				this.redirect("/cartlist");
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
